import axios from 'axios';
// 开发下接口路径
// import { message } from 'antd';


const httpID = 'http://192.168.1.230/';
// 对应
// const httpID = '/html';

export {
  httpID,
}
export function get(url, data) {

  data.forEach(item => {
    url += '/' + item;
  });
  console.log(httpID + url)
  return axios.get((httpID + url))
}

export function Delete(url, data) {
  data.forEach(item => {
    url += '/' + item;
  });
  console.log(httpID + url)
  return axios.delete((httpID + url))
}


export function post(url, data) {
  console.group('接口以及参数');
  console.log(httpID + url);
  data = JSON.stringify(data)
  console.log(data)
  console.groupEnd();
  return axios.post((httpID + url), data, {
    headers: {
      'Content-Type': 'application/json'
    }
  });
}

export function file(url, data) {
  console.group('接口以及参数');
  console.log(httpID + url);
  console.log(data)
  console.groupEnd();
  return axios.post((httpID + url), data, {
    // headers: {
    //     'Content-Type': 'multipart/form-data',
    //     // 'Content-Type': 'application/json'
    // }
  });
}